package com.ss.android.article.base.feature.message;

import android.util.Pair;
import com.ss.android.article.base.feature.update.a.a;
import org.json.JSONException;
import org.json.JSONObject;

public final class m extends a {
    public static final Pair<Integer,Integer> a;
    public static final Pair<Integer,Integer> b;
    public static final Pair<Integer,Integer> c;
    public long d;
    public long e;
    public long f;
    public String g;
    public String h;

    static {
        a = new Pair(Integer.valueOf(41), Integer.valueOf(100));
        b = new Pair(Integer.valueOf(101), Integer.valueOf(110));
        c = new Pair(Integer.valueOf(111), Integer.valueOf(120));
    }

    private m(long arg2) {
        super(arg2);
    }

    public final boolean a(JSONObject arg3) {
        super.a(arg3);
        this.d = arg3.optLong("dongtai_id");
        this.e = arg3.optLong("forum_id");
        this.f = arg3.optLong("dongtai_comment_id");
        this.g = arg3.optString("open_url");
        this.h = arg3.optString("extra_open_url");
        return true;
    }

    public final JSONObject a() throws JSONException {
        JSONObject v0 = new JSONObject();
        v0.put("id", this.i);
        v0.put("type", this.j);
        v0.put("content", this.k);
        if(this.o != null) {
            v0.put("user", this.o.toJson());
        }

        v0.put("dongtai_id", this.d);
        v0.put("dongtai_comment_id", this.f);
        v0.put("action_desc", this.l);
        v0.put("open_url", this.g);
        v0.put("extra_open_url", this.h);
        return v0;
    }

    public static m b(JSONObject arg6) {
        m v0 = null;
        if(arg6 != null) {
            long v2 = arg6.optLong("id");
            if(v2 > 0) {
                m v1 = new m(v2);
                if(v1.a(arg6)) {
                    v0 = v1;
                }
            }
        }

        return v0;
    }
}

